#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 20000;
int n, cnt;
struct pa
{
    int a, b;
    bool operator<(const pa& e) const
    {
        return double(a) / double(b) < double(e.a) / double(e.b);
    }
}p[N];
int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}
void out(int n)
{
    if (n == 0) return;
    for (int i = n - 1; i > 0; i--)
    {
        int d = gcd(i, n);
        if (d == 1) p[cnt++] = { i / d,n / d };
    }
    out(n - 1);
}
int main()
{
    cin >> n;
    out(n);
    sort(p, p + cnt);
    cout << "0/1" << endl;
    for (int i = 0; i < cnt; i++) cout << p[i].a << "/" << p[i].b << endl;
    cout << "1/1" << endl;
    return 0;
}